﻿using System;
using System.Collections.Generic;
using System.Text;
using Dzzzr.DataLayer;
using Dzzzr.Utils;

namespace Dzzzr
{
	public class CarController
	{
		public static List<CarInfo> GetCarList(int teamID)
		{
			return CBO.FillCollection<CarInfo, List<CarInfo>>(typeof(CarInfo), CarProvider.GetCarList(teamID));
			
		}
		public static CarInfo GetCar(int carID)
		{
			return CBO.FillObject<CarInfo>(typeof(CarInfo), CarProvider.GetCarList(carID));
		}
		public static void InsertCar(CarInfo car)
		{
			CarProvider.InsertCar(car.ID, car.Name, car.Description, 
				car.MaxSendingPause, car.Model, car.RegistrationNumber, car.Color);
		}
		public static void UpdateCar(CarInfo car)
		{
			CarProvider.UpdateCar(car.ID, car.Name, car.Description,
				car.MaxSendingPause, car.Model, car.RegistrationNumber, car.Color);
		}
		public static void DeleteCar(CarInfo Car)
		{
			CarProvider.DeleteCar(Car.ID);
		}


	}
}
